<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>

    <script src="https://unpkg.com/vue"></script>
    <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/vuex/3.1.1/vuex.min.js"></script> -->
    <style></style>
  </head>
  <body>
    <div id="app">
      <demo level="2"></demo>
    </div>
    <script>
      Vue.component("demo", { //render实现for循环
        props: ['level'],
        render(h) {
          let list = []
          for (let i = 0; i < 5; i++) {
            list.push(h('strong','h'))        // list= [VNODE,VNODE,VNODE,VNODE]    
          }
          return h('h'+this.level,list)
        }
      });
      new Vue({
        el: "#app",
        data() {
          return {
            post: {
              a: 1,
              b: 2
            }
          };
        }
      });
    </script>
  </body>
</html>
